Module Statistics
mod_df <- as.data.frame(table(cem_obj@module$modules), stringsAsFactors=FALSE)
colnames(mod_df) <- c("Module", "No.Genes")
DT::datatable(mod_df)
Modules - Profile Plot
if(length(cem_obj@profile_plot) > 0){
htmltools::tagList(lapply(cem_obj@profile_plot, plotly::ggplotly))
} else {
htmltools::h4("Please create profile plots!")
}
Gene Set Enrichment Analysis
if(!is.null(names(cem_obj@enrichment_plot))){
plot(cem_obj@enrichment_plot)
} else {
htmltools::h4("Please create enrichment plots!")
}

if(length(cem_obj@enrichment) > 0){
nes <- cem_obj@enrichment$nes
pv <- cem_obj@enrichment$pval
colnames(nes)[-1] <- paste0(colnames(nes)[-1], ": NES")
colnames(pv)[-1] <- paste0(colnames(pv)[-1], ": p-value")
# join p-values and nes
enrich_df <- merge(nes, pv, by.x="pathway")
# reorder columns
enrich_df <- enrich_df[, c("pathway", sort(colnames(enrich_df)[-1]))]
DT::datatable(enrich_df)
} else {
htmltools::h4("Please run enrichment analysis!")
}
Over Representation Analysis
if(nrow(cem_obj@ora) > 0){
columns <- c("ID", "Count", "GeneRatio", "BgRatio", "p.adjust")
ora_list <- split(cem_obj@ora[, columns], cem_obj@ora$Module)
tl <- htmltools::tagList()
there_is_barplot <- length(cem_obj@barplot_ora) > 0
for(i in seq(1, length(ora_list)*3, by=3)){
n <- names(ora_list)[ceiling(i/3)]
tl[[i]] <- htmltools::tags$h3(n)
if(there_is_barplot) {
tl[[i+1]] <- plotly::ggplotly(cem_obj@barplot_ora[[n]]$pl)
}
tl[[i+2]] <- DT::datatable(ora_list[[n]][1:max_rows_ora, ], options = list(pageLength=5))
}
htmltools::div(tl)
} else {
htmltools::h4("Please run over representation analysis!")
}
M1.A
M1.B
M2.A
M2.B
M3.B
M4.A
M4.B